<?php
//require_once('../user/wxbrower.php');
require_once("../includes/public.inc.php");
$s = isset($_GET['s'])?$_GET['s']:'';
$id = isset($_GET['id'])?$_GET['id']:'';
$status = isset($_GET['status'])?$_GET['status']:'';//暂时不使用，防止参数提交错误、中不中奖的判断
//使用防伪码进行查询，如果数据库有这个码，然后放到随机库里面查询，如果有就中奖没有就写很遗憾没有中奖randomcode
$fwm = mysql_fetch_array(mysql_query("select id,fwm,time from ".DBQIAN."fwm where fwm='".trim($s)."' and status=0 order by id desc limit 1"));//未使用
$praisename = mysql_fetch_array(mysql_query("select * from ".DBQIAN."praise where id=1 order by id desc limit 1"));//奖品
$praisecode = mysql_fetch_array(mysql_query("select id from ".DBQIAN."randomcode where randcode='".$fwm['id']."'  and status=0 order by id desc limit 1"));//中奖
//if ($status==1||$status==0)
//{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no,width=device-width, initial-scale=1.0 maximum-scale=1.0">
<meta name="Keywords" content="正品验证" />
<meta name="Description" content="正品验证" />
<title>FBK-获奖结果</title>
<link rel="stylesheet" href="Public/css/home.min.css" />
<script src="./Public/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	var ua = navigator.userAgent;
	var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
    isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
    isAndroid = ua.match(/(Android)\s+([\d.]+)/),
    isMobile = isIphone || isAndroid;
    if(isMobile) 
    {
        return true;
    }
    else
    {
        location.href = 'tip.php';
    }
    //或者单独判断iphone或android 
//    if(isIphone){
//        //code 
//    else if(isAndroid){
//        //code
//    }else{
//        //code
//    }
</script>
</head>
<body class="ui-bar-a" style="background:#A4002C;">
<img src="../images/FBKlogo.png" style="margin-left:17px; margin-top:10px;" width="90px" height="40px"/>
<div class="load_box" style="margin-top:-245px; width:280px; text-align:center;margin-left:-140px;">
	<?//if ($fwm&&$praisecode):?>
		<?
			//会员已经插进去数据库
			//$fr = mysql_query("update ".DBQIAN."fwm set time='".date('Y-m-d H:i:s',time())."',status=1 where id=".$fwm['id']);
			//$rm = mysql_query("update ".DBQIAN."randomcode set status=1 where id=".$praisecode['id']);
			//if ($fr&&$rm)
			//{
		?>
			<div style="margin-left:auto;margin-right:auto;top:7px;text-align:center;font-size:19px;font-weight:bolder;">
					恭喜你获得<br/>
					<span style="display:inline-block;margin-left:-8px;width:296px;color:yellow;font-size:16px;BORDER: #A4002C 1px solid;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius:6px;word-break:normal;"><?=$praisename['name']?></span><br/>
					<span style="font-size:10px;font-weight:bolder;">中奖名单,奖品发放信息将在微信公众平台公布</span>
			</div>
		<?
			//}
			//else 
			//{
				//$url = '404.php';
				//echo "<script language='javascript' type='text/javascript'>";
				//echo "alert('该防伪码为非法防伪码或参数提交错误！');window.location.href='$url'";
				//echo "</script>";
				//exit;
			//}
		?>
	<?//else:?>
		<?
			//$fr = mysql_query("update ".DBQIAN."fwm set time='".date('Y-m-d H:i:s',time())."',status=1 where id=".$fwm['id']);
			//if ($fr)
			//{
		?>
<!--			<div style="margin-left:auto;margin-right:auto;top:7px;text-align:center;font-size:19px;font-weight:bolder;">-->
<!--				很遗憾~没有中奖!<br/>欢迎再次购买!-->
<!--			</div>-->
		<?
			//}
			//else 
			//{
				//$url = '404.php';
				//echo "<script language='javascript' type='text/javascript'>";
				//echo "alert('该防伪码为非法防伪码或参数提交错误！');window.location.href='$url'";
				//echo "</script>";
				//exit;
			//}
		?>
	<?//endif;?>
</div>
<div class="load_box" style="margin-top:-170px;height:180px;width:280px;">
	<div style="position:absolute;top:55px;text-align:left;left:-18.5px;font-size:18px;font-weight:bolder;BORDER: #FFD300 1px solid;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius:6px;">感谢您对FBK刹车片的信任与支持,关注<span style="color:yellow">FBK</span>微信公众号，还可赢取年终"马来西亚五日游"大奖哦！
<br/><span style="font-size:10px;font-weight:bolder;">中奖名单,奖品发放信息将在次月15-20号在微信公众平台公布发放,更多活动还可长按下面的二维码关注的我们的公众号了解!</span></div>	
</div>
<div class="load_box" style="margin-top:25px;height:260px;">
	<div class="liwuso_logo"><img src="../images/t01739705f991e0d14f.gif" width="298px" /></div>
</div>
<footer id="footer" class="index_footer">
	<div class="copy">
		<div style="margin-left:-90px">
			<img src="../images/fbkqr.jpg"  width="100" height="100" /><span style="float:left;position:absolute;width:100px;font-size:14px;height:50px;text-align:left;margin-top:0px;">#长按关注#或者微信客户端搜索FBK摩擦制动的王者进行关注</span><br>
		</div>
		&copy;2015 FBK All Rights Reserved.
	</div>
</footer>
</body>
</html>
<?
//}
//else 
//{
//	$url = '404.php';
//	echo "<script language='javascript' type='text/javascript'>";
//	echo "alert('该防伪码为非法防伪码或参数提交错误！');window.location.href='$url'";
//	echo "</script>";
//	exit;
//}
?>